# _*_ coding: UTF-8 _*_
# 2020/4/15 20:19 
# PyCharm  
# Create by:LIUMINXUAN
# E-mail:liuminxuan1024@gmail.com
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt


def DrawHistogram_plot(src_image):
    plt.hist(src_image.ravel(), 256, [0, 255])
    plt.show()


if __name__ == "__main__":
    img_path = "../images/lena.jpg"
    src = cv.imread(img_path)
    # cv.namedWindow("src image", cv.WINDOW_AUTOSIZE)
    # cv.imshow("src image", src)
    DrawHistogram_plot(src)
    cv.waitKey(0)
    cv.destroyAllWindows()
